Skip to content

Instantly share code, notes, and snippets.

View ianldgs's full-sized avatar
💻
Hacking

Ian Luca ianldgs

💻
Hacking
View GitHub Profile
@Hexodus
Hexodus / count_total_project_code_lines_in_sublime
Created September 8, 2013 17:06
Count total code lines in project using Sublime texteditor
// Go to menue:
// find->find in files
// Switch on reg_ex button
// Find:
^(.*)$
// Where:
c:\your_folder\,*.php,*.phtml,*.js,*.inc,*.html, -*/folder_to_exclude/*
// Then click on the find button
// Be careful to not click on Replace!!!
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active July 23, 2024 04:22
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@richardkazuomiller
richardkazuomiller / proxy.js
Created February 19, 2014 06:52
node-http-proxy routing proxy with websockets
var httpProxy = require('http-proxy')
var proxy = httpProxy.createProxy({
ws : true
});
var options = {
'herp.dev': 'http://0.0.0.0:9008',
'derp.dev' : 'http://0.0.0.0:3000'
}
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active June 4, 2024 04:16
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@rjacoby
rjacoby / gist:46f7ceb900f97b0cc8f4
Created July 31, 2014 17:43
Facebook STOP! console code
__d("Chromedome", ["fbt"], function(a, b, c, d, e, f, g) {
f.start = function(h) {
if (h.off || top !== window ||!/(^|\.)facebook\.com$/.test(document.domain))
return;
var i = h.stop || "Stop!", j = h.text || "This is a browser feature intended for developers. If someone told you to copy-paste something here to enable a Facebook feature or \"hack\" someone's account, it is a scam and will give them access to your Facebook account.", k = h.more || g._("For more information, see {url}.", [g.param("url", 'https://www.facebook.com/selfxss')]);
if ((window.chrome || window.safari)&&!h.textonly) {
var l = 'font-family:helvetica; font-size:20px; ';
[[i, h.c1 || l + 'font-size:50px; font-weight:bold; ' + 'color:red; -webkit-text-stroke:1px black;'], [j, h.c2 || l], [k, h.c3 || l], ['', '']].map(function(r) {
setTimeout(console.log.bind(console, '\n%c' + r[0], r[1]));
});
@dweinstein
dweinstein / 0deodex.md
Last active July 4, 2018 22:59
tools for deodex android--must download the .jar files separately (smali/baksmali: https://bitbucket.org/JesusFreke/smali/downloads | apktool: https://bitbucket.org/iBotPeaches/apktool/downloads)

A few utilities to help with de-odexing.

You'll need to download baksmali/smali/apktool jars and link/rename the jars as appropriate (e.g., apktool.jar, smali.jar, baksmali.jar) in the directory with these scripts.

You can grab the utilities (currently) from bitucket:

@ilyesgouta
ilyesgouta / chromecast.js
Created March 26, 2015 22:16
A node.js snippet to stream media files to a Chromecast device
// A node.js snippet to stream media files to a Chromecast device.
// An ac3 or dts audio stream in matroska containers is transcoded to mp3
// using ffmeg. Seeking using left and right keys won't be available.
var Client = require('castv2-client').Client;
var DefaultMediaReceiver = require('castv2-client').DefaultMediaReceiver;
var mdns = require('mdns');
@bbeckercontato
bbeckercontato / geradorprimosphi42.py
Created February 2, 2016 18:16
Gerador de numeros primos no conjunto de phi(42*n) - Teoria matemática de Bruno Becker
limite = int(input("Digite limite: "))
contador = 0
base2=[]
primos=[]
base = [ 1, 5, 11, 13, 17, 19, 23, 25, 29, 31, 37, 41]
pa=[]
@philipstanislaus
philipstanislaus / sane-caching.nginx.conf
Last active July 6, 2024 12:09
Sample Nginx config with sane caching settings for modern web development
# Sample Nginx config with sane caching settings for modern web development
#
# Motivation:
# Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools.
# These tools automatically deactivate all sorts of caching for you, so you always have a fresh
# and juicy version of your assets available.
# At some point, however, you want to show your work to testers, your boss or your client.
# After you implemented and deployed their feedback, they reload the testing page – and report
# the exact same issues as before! What happened? Of course, they did not have developer tools
# open, and of course, they did not empty their caches before navigating to your site.
@Rich-Harris
Rich-Harris / service-workers.md
Last active July 10, 2024 17:04
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.