Skip to content

Instantly share code, notes, and snippets.

Daniel Nilsson danijeel

Block or report user

Report or block danijeel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@danijeel
danijeel / gist:5274070
Last active Dec 15, 2015
ChromeGesture
View gist:5274070
{
"name": "Chrome Gestures",
"version": "1.12.1",
"normal_actions": {
"UD": {
"name": "reload",
"args": []
},
"UDU": {
"name": "cacheless reload",
@danijeel
danijeel / gist:5669354
Created May 29, 2013
Javascript ASYNC
View gist:5669354
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript';
po.async = true; po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);
})();
</script>
@danijeel
danijeel / cdRomEject_every_10_second.vbs
Created Dec 16, 2013
Annoying Windows script to eject cdrom every 10 second
View cdRomEject_every_10_second.vbs
set oWMP = CreateObject("WMPlayer.OCX.7")
set colCDROMs = oWMP.cdromCollection
wscript.sleep 10
do
if colCDROMs.Count >= 1 then
for i = 0 to colCDROMs.Count -1
colCDROMs.Item(i).Eject
Next
For i = 0 to colCDROMs.Count -1
colCDROMs.Item(i).Eject
@danijeel
danijeel / index.php
Last active Aug 29, 2015
List all project, press enter, voliá!
View index.php
<?php
foreach (new DirectoryIterator('.') as $fileInfo) {
if($fileInfo->isDot()) continue;
if($fileInfo->isDir()) $folders[] = $fileInfo->getFilename();
if($fileInfo->isFile() && $fileInfo->getExtension() == 'php') {
if (!in_array($fileInfo->getFilename(), array('index.php', 'error.php', '404.php'))) {
$files[] = $fileInfo->getFilename();
}
}
}
@danijeel
danijeel / convert
Last active Aug 29, 2015
Convert files to utf-8 and remove utf8_decode / utf8_encode Proof of concept
View convert
#!/usr/bin/env php
<?php
/**
* PHP convert file encoding
*
* Command-line script to convert php files encoding to UTF-8
* This has only been tested on a macbook. proberbly works on unix systems
*
* Required file-5.04, iconv (GNU libiconv 1.11)
* https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/file.1.html
View create_labels.sh
#!/usr/bin/env bash
# Colours picked from https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/
###
# Label definitions
###
declare -A LABELS
## Platform
View keybase.md

Keybase proof

I hereby claim:

  • I am danijeel on github.
  • I am danijeel (https://keybase.io/danijeel) on keybase.
  • I have a public key whose fingerprint is F928 2329 DBF9 5448 27B9 9D6F F23E 000A 2F0D 0C55

To claim this, I am signing this object:

@danijeel
danijeel / usb_debug.log
Created Sep 4, 2017
trying to start wifi
View usb_debug.log
09-04 10:10:13.893 713-742/? E/ANDR-PERF-OPTSHANDLER: Warning: Resource [2, 0] not supported for core 1. Instead use resource for core 0
09-04 10:10:13.894 713-742/? E/ANDR-PERF-RESOURCEQS: Failed to apply optimization [2, 2, 0]
09-04 10:10:13.913 682-682/? E/android.hardware.wifi@1.0-service: Failed to write wlan fw path param: No such device
09-04 10:10:13.913 682-682/? E/android.hardware.wifi@1.0-service: Failed to change firmware mode
09-04 10:10:13.914 990-1698/? E/HalDeviceManager: executeChipReconfiguration: configureChip error: 9 ()
09-04 10:10:13.914 990-1698/? E/WifiVendorHal: Failed to create STA Iface. Vendor Hal start failed
09-04 10:10:14.115 682-682/? E/hw-IPCThreadState: binder thread pool (1 threads) starved for 201 ms
09-04 10:10:14.115 990-1698/? E/WifiNative-wlan0: Failed to start HAL for client mode
09-04 10:10:14.116 990-990/? E/WifiController: WifiControllerWifi turn on failed
09-04 10:10:14.153 682-682/? E/android.hardware.wifi@1.0-service: Failed to write wlan fw path param: No such d
@danijeel
danijeel / shutdown.js
Last active Feb 2, 2018
#windows Windows 10 shutdown prompt (Alt+F4)
View shutdown.js
(new ActiveXObject("Shell.Application")).ShutdownWindows();
@danijeel
danijeel / index.sh
Last active Aug 9, 2018
#bash #boilerplate
View index.sh
#!/bin/bash
# https://explainshell.com/explain?cmd=set+-euxo%20pipefail
set -eou pipefail
yell() { echo "$0: $*" >&2; }
die() { yell "$*"; exit 111; }
try() { echo "$ $@" 1>&2; "$@" || die "cannot $*"; }
# log to syslog and echo output
info() {
You can’t perform that action at this time.