Skip to content

Instantly share code, notes, and snippets.

View meetajhu's full-sized avatar
🔧
Bun + Elysia + Prisma

Hanif Roshan meetajhu

🔧
Bun + Elysia + Prisma
View GitHub Profile
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 17, 2024 12:37
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@trusktr
trusktr / DefaultKeyBinding.dict
Last active May 17, 2024 01:58
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@KelseyDH
KelseyDH / ruby_rails_windows.md
Last active May 16, 2024 07:48
Ruby on Rails Microsoft Windows Troubleshooting Tips

Ruby on Rails Windows Troubleshooting Tips & Survival Guide

Intro/Overview

The Ruby on Rails Windows Troubleshooting tips & Survival Guide is a random catalogue of issues I faced working with Ruby on Rails on Windows (Windows 7 specifically). This guide is not exhaustive, but covers many of the challenges that causes Windows Ruby developers to jump ship to Linux or Mac. If you're reading this guide then you're probably new to Ruby/Rails, so also included is more general beginner advice to help you get going.

Personal Side Note

Before you follow this guide, I strongly recommend you consider using Linux or Mac OS X for Ruby Development instead. Looking to prove a point as a challenge, I ignored this strongly given advice while learning Ruby/Rails. While I eventually did succeed in getting Ruby on Rails to work in Windows, it was not easy, and I easily lost 40+ hours on StackOverFlow to Windows/Ruby configuration issues--time I could have devoted to learning more about th

#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@barbietunnie
barbietunnie / udemy-courses-download-using-cookies.md
Last active May 10, 2024 18:17
Downloading Udemy videos with youtube-dl

How to download your Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)[1] export extension. Save it to file udemy-cookies.txt
  3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.
$ youtube-dl {course_link} --cookies {path_to_cookies_file}
@giannisp
giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active March 1, 2024 14:39
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
@emiloberg
emiloberg / GaugeChart.js
Last active February 13, 2024 14:30
Gauge Chart with React Recharts (http://recharts.org)
import React from 'react';
import { Sector, Cell, PieChart, Pie } from 'recharts';
const GaugeChart = () => {
const width = 500;
const chartValue = 180;
const colorData = [{
value: 40, // Meaning span is 0 to 40
color: '#663399'
}, {
@hubgit
hubgit / SelectField.tsx
Last active December 29, 2023 03:41
Use react-select with Formik
import { FieldProps } from 'formik'
import React from 'react'
import Select, { Option, ReactSelectProps } from 'react-select'
export const SelectField: React.SFC<ReactSelectProps & FieldProps> = ({
options,
field,
form,
}) => (
<Select
@Chak10
Chak10 / randomDarkColor.js
Last active December 9, 2023 06:04
Javascript Random Dark Color
function randDarkColor() {
var lum = -0.25;
var hex = String('#' + Math.random().toString(16).slice(2, 8).toUpperCase()).replace(/[^0-9a-f]/gi, '');
if (hex.length < 6) {
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
}
var rgb = "#",
c, i;
for (i = 0; i < 3; i++) {
c = parseInt(hex.substr(i * 2, 2), 16);