Skip to content

Instantly share code, notes, and snippets.

View Neoglyph's full-sized avatar
🧙
wizard in training since 1989

Adam Stradovnik Neoglyph

🧙
wizard in training since 1989
View GitHub Profile
@Neoglyph
Neoglyph / rebase-commits-pushed
Created July 13, 2018 16:03
Rebase already pushed commits
# example merging 4 commits
git checkout mybranch
git rebase -i mybranch~4 mybranch
# at the interactive screen
# choose fixup for commit: 2 / 3 / 4
git push -u origin +mybranch
@Neoglyph
Neoglyph / indesign-select-folder.js
Last active May 24, 2018 14:11
InDesign Select Folder + All Files Script
var myFolder = Folder.selectDialog("Select a folder with InDesign files");
if (!myFolder)
exit(0);
var myFileList = myFolder.getFiles();
for (var i = 0; i < myFileList.length; i++) {
@Neoglyph
Neoglyph / indesign-import-xml.js
Created May 24, 2018 12:59
InDesign Import XML
main ()
function main () {
// create a path for a file object
var curFile = File ( "~/Desktop/myTemplate.indt" );
// check if the file exists
if (!curFile.exists) {
alert ( "no template!" );
exit();
}
@Neoglyph
Neoglyph / dynamicConfig.php
Last active April 5, 2018 08:49
Create dynamic config entries from database - Laravel (5.5/5.6)
<?php
// Laravel 5.5/5.6
// AppServiceProvider
public function boot() {
// If we have a database table with configs...
if (Schema::hasTable('table_with_config')) {
// Get all database stored configs
// DatabaseConfigs is a Model
@Neoglyph
Neoglyph / gist:6f64b0a1b95fd8ecb295efcab97ab4aa
Created February 26, 2018 08:25
Docker getting inside a container or image
// Found on stackoverflow from: https://stackoverflow.com/users/5641227/khalil-gharbaoui
This command should let you explore a running docker container:
docker exec -it name-of-container bash
once inside do:
ls -lsa
or any other bash command like:
@Neoglyph
Neoglyph / symlink.js
Created February 23, 2018 14:49
Create symlink in nodejs
@Neoglyph
Neoglyph / script
Created February 20, 2018 08:36
High quality PDF to Image convert using Imagemagick
convert -density 1200 source.pdf -resize 25% -background white -alpha remove -append resultimage.jpg
@Neoglyph
Neoglyph / capital_count.php
Created January 18, 2018 12:33
Count capital leters inside a sentence
<?php
public static function countCapitalLetters($string){
$lowerCase = mb_strtolower($string);
return strlen($lowerCase) - similar_text($string, $lowerCase);
}
@Neoglyph
Neoglyph / chrome-autofill.css
Created January 4, 2018 12:57
Remove chrome autofill input background
/* Change background color */
input:-webkit-autofill {
-webkit-box-shadow: 0 0 0 30px white inset;
}
/* Change text color */
input:-webkit-autofill {
-webkit-text-fill-color: black !important;
}
@Neoglyph
Neoglyph / extensions.json
Last active November 10, 2023 10:29
VSCode's Settings - Syncing
[
{
"id": "aaron-bond.better-comments",
"name": "better-comments",
"publisher": "aaron-bond",
"version": "3.0.2"
},
{
"id": "adamgirton.gloom",
"name": "gloom",