Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Use -gt 1 to consume two arguments per pass in the loop (e.g. each
# argument has a corresponding value to go with it).
# Use -gt 0 to consume one or more arguments per pass in the loop (e.g.
# some arguments don't have a corresponding value to go with it such
# as in the --default example).
# note: if this is set to -gt 0 the /etc/hosts part is not recognized ( may be a bug )
while [[ $# -gt 1 ]]
do
key="$1"
(function(Backbone) {
if (Backbone && Backbone.ChildViewContainer) {
_.extend(Backbone.ChildViewContainer.prototype, {
indexOf: function(view) {
return _.values(this._views).indexOf(view)
}
})
}
Backbone.Model.prototype.put = function(prop, options) {
if (this.isNew()) {
@eni9889
eni9889 / install.sh
Created December 28, 2017 22:00 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
@eni9889
eni9889 / task_for_pid.c
Created January 2, 2018 04:20 — forked from attilathedud/task_for_pid.c
Mac OS X El Capitan (10.11) and task_for_pid()
/*
Full explanation is available here: http://attilathedud.me/mac-os-x-el-capitan-10-11-and-task_for_pid/
*/
/*
To compile, create a file called Info.plist with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@eni9889
eni9889 / pptweaks_electra.md
Last active February 9, 2024 05:50
Installing ++ Tweaks on Electra

WAIT FOR CYDIA

@eni9889
eni9889 / gist:b637abc909274c38c1f2a913946e101c
Created January 23, 2018 19:43
Installing Instagram ++ on Electra
*******************
The following commands should be run on the device using SSH
Please only do this if you are okay with risking your JB.
******************
First install uasharedtools if you don't have it:
```
/bootstrap/usr/local/bin/wget -O - http://repo.unlimapps.com/electra/com.unlimapps.uasharedtools/electra.sh | /bootstrap/bin/bash
```
@eni9889
eni9889 / hello.h
Created February 12, 2018 21:04 — forked from ddrccw/hello.h
detect jailbreak
//
// Created by ddrccw on 14-1-10.
// Copyright (c) 2014年 ddrccw. All rights reserved.
// refer to http://danqingdani.blog.163.com/blog/static/1860941952012102122847478/
#import <sys/stat.h>
#import <mach-o/dyld.h>
//#import <stdlib.h>
//#import <string.h>
@eni9889
eni9889 / generate_namespace_header.sh
Created March 12, 2018 03:10
Generate Namespace Headers
# This script is a modified version of this: https://github.com/jverkoey/nimbus/blob/master/scripts/generate_namespace_header
header=$SRCROOT/ext/NamespacedDependencies.h
prefix="YOUR_PREFIX_HERE"
echo "Generating $header from $CODESIGNING_FOLDER_PATH..."
echo "// Namespaced Header
#ifndef __NS_SYMBOL
@eni9889
eni9889 / Gemfile
Created December 31, 2018 21:18 — forked from SeriouslyAwesome/Gemfile
ActiveAdmin association autocomplete without complicated plugins.
gem 'active_model_serializers'
gem 'activeadmin'
gem 'jquery-ui-rails'
@eni9889
eni9889 / read-access.sql
Created January 25, 2019 18:37 — forked from oinopion/read-access.sql
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;