Skip to content

Instantly share code, notes, and snippets.

@jedi4ever
jedi4ever / dpkg-gnutar
Created March 17, 2011 08:41
homebrew formula to get dpkg working a mac
require 'formula'
class Tar <Formula
url 'http://ftp.gnu.org/gnu/tar/tar-1.26.tar.gz'
homepage 'http://www.gnu.org/software/tar/'
md5 '00d1e769c6af702c542cca54b728920d'
# depends_on 'cmake'
def install
@chasereeves
chasereeves / gist:3124135
Created July 16, 2012 18:25
Wordpres Custom Menu/Navigation Walker - remove all list items from menu, only links remain.
//========================================================== CUSTOM MENU WALKER - remove list stuff, only links
class custom_menu_walker_remove_list extends Walker_Nav_Menu {
function start_el(&$output, $item, $depth, $args) {
global $wp_query;
$class_names = $value = '';
$classes = empty( $item->classes ) ? array() : (array) $item->classes;
$classes[] = 'menu-item-' . $item->ID;
$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) );
$class_names = ' class="' . esc_attr( $class_names ) . '"';
$id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );
@Lewiscowles1986
Lewiscowles1986 / lc-svg-upload.php
Last active August 4, 2016 13:45
SVG Media Plugin for WordPress (Works since 4.1.2!)
<?php
// Please see https://github.com/Lewiscowles1986/WordPressSVGPlugin from now on
@sou-lab
sou-lab / wp.fish
Created March 25, 2016 16:59
wp-cli fish completion
# wp-cli
complete -c wp -l cache --description 'Manage the object cache.'
complete -c wp -l cap --description 'Manage user capabilities.'
complete -c wp -l cli --description 'Get information about WP-CLI itself.'
complete -c wp -l comment --description 'Manage comments.'
complete -c wp -l core --description 'Download, install, update and otherwise manage WordPress proper.'
complete -c wp -l cron --description 'Manage WP-Cron events and schedules.'
complete -c wp -l db --description 'Perform basic database operations.'
complete -c wp -l eval --description 'Execute arbitrary PHP code.'
complete -c wp -l eval-file --description 'Load and execute a PHP file.'
@cmacdonnacha
cmacdonnacha / color-palette.scss
Created April 6, 2016 13:05
Material Design Color Palette
$white: #ffffff;
$black: #000000;
$red50: #ffebee;
$red100: #ffcdd2;
$red200: #ef9a9a;
$red300: #e57373;
$red400: #ef5350;
$red500: #f44336;
$red600: #e53935;
$red700: #d32f2f;
@arigesher
arigesher / responsive-flickr-embeds
Last active October 26, 2020 08:20
JQuery code to make Flickr embeds responsive (and resize correctly when loading in a mobile browser). See http://ari.gesher.net/photos-the-gesher-world-tour/ for a working example.
$(document).ready(function() {
$("#pics iframe").each(function(index) {
var ratio = $(this).height() / $(this).width();
var origHeight = $(this).height();
var origWidth = $(this).width();
var self = this;
// bind to window with closure that references the
// iframe since the iframe doesn't get resize events
// until (you know) we resize it.
$(window).resize(function() {
@tihmstar
tihmstar / Odyssey14_leak.cpp
Last active April 27, 2021 17:13
Stable internal kernelRW primitives #odyssey14 #leak
extern "C"
void initKernRw(mach_port_t dstTask, uint64_t dstTaskAddr, uint64_t (*kread64)(uint64_t addr), void (*write_20)(uint64_t addr, const void *buf)){
KernelRW *newKrw = new KernelRW;
auto p = newKrw->getPrimitivepatches(kread64,dstTaskAddr);
{
uint8_t buf[20];
for (int i=0; i<sizeof(buf); i+=8) {
*((uint64_t*)&buf[i]) = kread64(p.where-20+8+4+i);
@nullpixel
nullpixel / write_memory.c
Last active October 17, 2021 16:12
MSHookMemory wrapper for all modern jailbreaks.
#include <mach/mach.h> // mach_task_self, vm_protect
#include <substrate.h> // MSFindSymbol
// MARK: - Types
typedef void (*MSHookMemory_ptr_t)(void *target, const void *data, size_t size);
#define ENSURE_KERN_SUCCESS(ret) \
if (ret != KERN_SUCCESS) { \
@ismailmechbal
ismailmechbal / sketch-never-ending.md
Last active January 28, 2022 04:23
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

@ndbroadbent
ndbroadbent / gist:3030358
Created July 2, 2012 01:16
Tiny Umbrella Crash
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/sun/jna/Platform
at com.semaphore.os.UIHandlerManager.getSystemUIHandler(UIHandlerManager.java:22)
at com.semaphore.TinyUmbrella.<clinit>(TinyUmbrella.java:131)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.semaphore.TinyLoader.loadTiny(TinyLoader.java:248)
at com.semaphore.TinyLoader.access$000(TinyLoader.java:29)
at com.semaphore.TinyLoader$1.run(TinyLoader.java:42)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)