Skip to content

Instantly share code, notes, and snippets.

View ikem-krueger's full-sized avatar

Ikem Krueger ikem-krueger

View GitHub Profile
@davidnunez
davidnunez / gist:1404789
Created November 29, 2011 13:20
list all installed packages in android adb shell
pm list packages -f
@jeje
jeje / gist:3027236
Created July 1, 2012 06:58
Arduino Sketch recording raw IR signal and sending it through an infrared LED again every 2 seconds
#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
IRsend irsend;
boolean recording = true;
decode_results results;
@ninjascribble
ninjascribble / node-user-agent.js
Last active December 22, 2023 02:42
Fetching the user-agent string from a request using either NodeJS or NodeJS + Express
/** Native NodeJS */
var http = require('http')
, server = http.createServer(function(req) {
console.log(req.headers['user-agent']);
});
server.listen(3000, 'localhost');
/** NodeJS with Express */
var express = require('express')
@kylemanna
kylemanna / connmanctl.md
Last active June 27, 2023 23:12
Connmanctl Cheat Sheet
@mattlewissf
mattlewissf / add-p.md
Last active April 23, 2024 09:19
Lightning Talk: Git add -p

git add -p is your friend

git add -p is basically "git add partial (or patch)"

Patch mode allows you to stage parts of a changed file, instead of the entire file. This allows you to make concise, well-crafted commits that make for an easier to read history. This feature can improve the quality of the commits. It also makes it easy to remove parts of the changes in a file that were only there for debugging purposes - prior to the commit without having to go back to the editor.

It allows you to see the changes (delta) to the code that you are trying to add, and lets you add them (or not) separately from each other using an interactive prompt. Here's how to use it:

from the command line, either use

  • git add -p
@daniellevass
daniellevass / android_material_design_colours.xml
Last active March 26, 2024 15:48
Android Material Design Colours
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>
@neslekkim
neslekkim / monitorissues
Last active November 14, 2023 21:16
When all Windows are resized after your monitor have been power-recycled
Some monitors (especially hdmi/TV monitors) don't keep the hdmi port "alive" when they are powered down.
As a result, when windows reboots or comes out of sleep, it can't detect a monitor, so it sets resolution to it's "SIMULATED" monitor registry entry in the key at;
HKLM\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration
This can be manually edited to contain the actual screen registration of your default monitor.
Change these keys:
Under each is a tree called "00" two of the keys are
PrimSurfSize.cx
@sv99
sv99 / How can I replace a newline (\n) using sed.md
Last active December 5, 2023 13:43
How can I replace a newline (\n) using sed?

stackoverflow (hdorio)

Fast answer:

sed ':a;N;$!ba;s/\n/ /g' file
  1. :a create a label 'a'
  2. N append the next line to the pattern space
  3. $! if not the last line, ba branch (go to) label 'a'
  4. s substitute, /\n/ regex for new line, / / by a space, /g global match (as many times as it can)
@tayvano
tayvano / gist:6e2d456a9897f55025e25035478a3a50
Created February 19, 2017 05:29
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
@hpaul-osi
hpaul-osi / DisablingServicesOnServer2016wDE.ps1
Created June 11, 2017 01:41
Disable unnecessary services that on Windows Server 2016 Desktop Experience (based on MS Security Blog recommendations)
# Disable extraneous services on Server 2016 Desktop Experience
# https://blogs.technet.microsoft.com/secguide/2017/05/29/guidance-on-disabling-system-services-on-windows-server-2016-with-desktop-experience/
Configuration DisablingServicesOnServer2016wDE
{
param(
[String]$ComputerName = "localhost",
[ValidateSet('ShouldBeDisabledOnly','ShouldBeDisabledAndDefaultOnly','OKToDisable','OKToDisablePrinter','OKToDisableDC')]
[String]$Level = 'OKToDisable'
)