Skip to content

Instantly share code, notes, and snippets.

View AdrianoCahete's full-sized avatar
🎯
Focusing

Adriano Cahete AdrianoCahete

🎯
Focusing
View GitHub Profile
@wormeyman
wormeyman / Source_Code_Pro_Powershell_font.ps1
Last active March 10, 2020 10:26
Set Adobe's Source Code Pro as a PowerShell font option.
#Reference: http://michaellwest.blogspot.com/2013/03/add-font-to-powershell-console.html
#Reference: http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q247815 This explains why we name it 000
Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont' #Get the properties of TTF
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont' -Name 000 -Value 'Source Code Pro' #Set it to SCP
Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont' #Check to see if we properly set it so that SCP is an option
@ntwb
ntwb / ntwb_remove_protected_private_titles.php
Created January 28, 2014 04:38
bbPress - Custom Remove 'Protected:' and 'Private:' title prefixes
<?php
/*
Plugin Name: bbPress - Custom Remove 'Protected:' and 'Private:' title prefixes
Plugin URI: https://gist.github.com/ntwb/8662354
Description: bbPress - Custom Remove 'Protected:' and 'Private:' title prefixes
Version: 0.1
Author: Stephen Edgar - Netweb
Author URI: http://netweb.com.au
*/
<div id="transcript">&nbsp;</div>
<br>
<div id="instructions">&nbsp;</div>
<div id="controls">
<button id="start_button">Click to Start</button>
</div>
<style>
@Noahii
Noahii / meh.puhhuhpuh
Created October 10, 2013 15:44
BF4 battlelog JSON stats thing for PHP
<?php
//Self Explanatory \
$postchars = http_build_query(array(
'redirect' => '',
'email' => '[email protected]',
'password' => 'wdfaqwgaf',
'submit' => 'Log+in'
), '', '&');
@cowboy
cowboy / #bf4-emblem-import-export.md
Last active November 25, 2024 12:04
JavaScript: BF4 Battlelog Emblem Import / Export

Exporting an emblem

  1. Log into BF4 Battlelog.
  2. Visit the Customize emblem page.
  3. Select the emblem you wish to export.
  4. Open the console (Ctrl-Shift-J).
  5. Enter the following code snippet to copy the raw emblem data to the clipboard:
    copy('emblem.emblem.load('+JSON.stringify(emblem.emblem.data,null,2)+');');
  6. Paste somewhere useful, like a gist. Whatever.
  7. Close the console (Ctrl-Shift-J).
@thitemple
thitemple / dev_setup.ps1
Last active November 12, 2024 15:00
A PowerShell script for installing a dev machine using Chocolatey.
function Add-Path() {
[Cmdletbinding()]
param([parameter(Mandatory=$True,ValueFromPipeline=$True,Position=0)][String[]]$AddedFolder)
# Get the current search path from the environment keys in the registry.
$OldPath=(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path
# See if a new folder has been supplied.
if (!$AddedFolder) {
Return 'No Folder Supplied. $ENV:PATH Unchanged'
}
# See if the new folder exists on the file system.
@localnerve
localnerve / tfscheckout
Last active May 12, 2016 20:28
Example of using TFS with Grunt (not that you would want to do this, but it can work). Employs the grunt-shell task so that TFS targets play well with other tasks that spawn (like grunt-contrib-compass).
//
// Example showing how to use TFS with grunt.
// Plays well with grunt-contrib-compass and other tasks that spawn processes.
// This example only shows tf checkout, but you could reuse this pattern to add more tf commands.
//
// Gist by https://github.com/localnerve, http://www.localnerve.com
//
var path = require("path");
module.exports = function(grunt) {
<?php
/**
* @file
* Default theme implementation to display the basic html structure of a single
* Drupal page.
*
* Variables:
* - $css: An array of CSS files for the current page.
* - $language: (object) The language the site is being displayed in.
@Hypercubed
Hypercubed / README.md
Last active December 12, 2021 02:23
DocPad: rsync Deploy Script

DocPad: rsync Deploy Script

  • Place deploy.sh in {docpad folder}/bin/
  • Create (or edit) a .env file in your docpad folder with the following values:
#!/bin/bash
DEPLOY_SOURCE_DIR="out/"
DEPLOY_DEST_DIR="~/public_html/"
DEPLOY_SERVER=deploy-server-name
@altrive
altrive / Test-RebootRequired.ps1
Last active August 3, 2023 14:34
Check pending reboot on local computer
#Based on <http://gallery.technet.microsoft.com/scriptcenter/Get-PendingReboot-Query-bdb79542>
function Test-RebootRequired
{
$result = @{
CBSRebootPending =$false
WindowsUpdateRebootRequired = $false
FileRenamePending = $false
SCCMRebootPending = $false
}