Skip to content

Instantly share code, notes, and snippets.

View ahmgeek's full-sized avatar
🛠️
Catching some ⛅️⛅️

Ahmad ahmgeek

🛠️
Catching some ⛅️⛅️
View GitHub Profile
@mustafa-zidan
mustafa-zidan / search_insert.go
Created February 24, 2020 19:59
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
func searchInsert(nums []int, target int) int {
start, end := 0, len(nums)
if len(nums) == 0 || target < nums[start] {
return 0
} else if target > nums[end-1] {
return len(nums)
}
return getIndex(start, end, target, nums)
}
@JoshCheek
JoshCheek / duo_lingo_clone.rb
Created June 12, 2019 04:40
Duo Lingo clone
#!/usr/bin/env ruby
require 'readline'
# copied from https://www.vistawide.com/spanish/top_100_spanish_words.htm
list = <<~WORDS
el / la (def. art.) the
de (prep.) of, from
que (conj.) that, which
y (conj.) and
a (prep.) to, at
@JoshCheek
JoshCheek / abandon_all_hope_ye_who_enter_here.md
Last active May 30, 2019 06:20
Evil Ruby: Turning procs into first class functions
  • To read the original tweet and comments, click here.
  • For my followup abomination, click here
  • If you're thinking about treating this as anything other than art, read there 👇

DISCLAIMER:

THIS IS ART, DON'T ACTUALLY DO THIS IN ANY CODE THAT YOU CARE ABOUT!

☠️ This is not a place of honor ☠️ >

@dannguyen
dannguyen / tweet-selenium.py
Last active December 14, 2022 07:45
how to send a tweet through Firefox using Python + Selenium
"""
Tweeting by controlling Firefox via Python + selenium
http://selenium-python.readthedocs.org/
This script:
- Opens up Firefox
- Goes to https://www.twitter.com
- Clicks the login button
- logs you in (assuming you have your twitter password in a file named `mypassword.txt`...)
@julz
julz / main.go
Created November 20, 2015 12:39
containersched minicontainer
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {
@yowu
yowu / HttpProxy.go
Last active March 26, 2025 05:23
A simple HTTP proxy by Golang
package main
import (
"flag"
"io"
"log"
"net"
"net/http"
"strings"
)

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@sevko
sevko / README.md
Last active December 27, 2024 09:19
Compile a full-featured Vim (w/ Python, Ruby, etc.).

compile full Vim

The default Vim installed on most Linux distros lacks a number of vital features, like xterm_clipboard (allows copy-and-pasting to the system clipboard) and python (on which certain plugins rely). The compile_full_vim.sh shell script removes the currently installed Vim and compiles a full-featured version; it's based entirely off Valloric's YouCompleteMe walkthrough, which it bundles into a simple script for convenience. Vim will be compiled with the following feature flags:

  • --with-features=huge
  • --enable-multibyte
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 7, 2025 23:53
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname