Skip to content

Instantly share code, notes, and snippets.

View johnbocook's full-sized avatar
💯
I come here for the dark theme.

John Bocook johnbocook

💯
I come here for the dark theme.
View GitHub Profile
@johnbocook
johnbocook / Add WWW
Last active September 28, 2017 07:04
htaccess stuff
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
@johnbocook
johnbocook / blazerPadding.css
Created September 28, 2017 06:20
Padding styles used in blazer framework.
/* Padding and Margins */
/* 0 */
.padding-top-0 {
padding-top: 0px;
}
.padding-bottom-0 {
padding-bottom: 0px;
}
.padding-left-0 {
@johnbocook
johnbocook / Tool List
Created September 28, 2017 05:51
OSX Tools
Homebrew
https://brew.sh/
Oh-My-Zsh
https://github.com/robbyrussell/oh-my-zsh/
Lepton
http://hackjutsu.com/Lepton/
iTerm2 version 3
@johnbocook
johnbocook / isLocal.js
Created August 28, 2017 19:37
Javascript, check if localhost
var isLocal = location.host.includes('localhost');
@johnbocook
johnbocook / Milliseconds -to-seconds.js
Created August 1, 2017 23:46
Milliseconds to seconds
function millisToMinutesAndSeconds(millis) {
var minutes = Math.floor(millis / 60000);
var seconds = ((millis % 60000) / 1000).toFixed(0);
return minutes + ":" + (seconds < 10 ? '0' : '') + seconds;
}
@johnbocook
johnbocook / Select2Demo.markdown
Created July 20, 2017 18:08
Select2 Demo - Dynamic Work Tasks

Select2 Demo

Example useage of Select2 to add and edit multiple activities to user. This gives freedom of dynamic communication and action plans that can be quickly edited and customized on a user by user basis.

A Pen by John Bocook on CodePen.

License.

@johnbocook
johnbocook / js-date-compare.js
Created July 17, 2017 12:21
Javascript Date Compare
var myDate = '05/05/2019';
var today = new Date();
function process(date) {
var parts = date.split("/");
return new Date(parts[2], parts[1] - 1, parts[0]);
}
if (process(myDate) <= today) {
@johnbocook
johnbocook / cfscript-if-year-is-old.cfm
Created March 21, 2017 18:21
Cfscript, if year is older than this year do something.
if (dateDiff("yyyy", date_maint, now()) <= 0){
writeOutput('new' & date_maint &'</span>');
} else {
writeOutput('old' & date_maint &'</span>');
}
Press Windows Key + R on your keyboard.
Key in PowerShell and hit Enter.
Right click on the PowerShell icon on the taskbar and select Run as Administrator.
Now paste the following command in the Administrator: Windows PowerShell window and press Enter key:
Get-AppXPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
NOW for the important part ! Locate to : C:/Users/name/AppData/Local/ and delete the TileDataLayer folder. Should fix everything immediately, no reboot necessary. Let me know how it works for you, it did for me! And remember to clean the recycle bin after you deleted the folder and give it 1min then everything is back to normal !
@johnbocook
johnbocook / Bash MySQL to SQLlight.sh
Created December 22, 2016 08:48
MySQL to SQLlight converterin Bash
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite