Skip to content

Instantly share code, notes, and snippets.

@RuGa
RuGa / massInsertOrUpdate.php
Last active June 3, 2024 15:50
Mass (bulk) insert or update on duplicate for Laravel 4/5
/**
* Mass (bulk) insert or update on duplicate for Laravel 4/5
*
* insertOrUpdate([
* ['id'=>1,'value'=>10],
* ['id'=>2,'value'=>60]
* ]);
*
*
* @param array $rows
@pepebe
pepebe / gist:4554926
Created January 17, 2013 09:52
SQL: Repair German "Umlaute" inside a MySQL Database.
<?php
/**
* Alle kaputten Umlaute reparieren bei Umstellung von ISO->UTF8
* Source: http://xhtmlforum.de/66480-kleines-skript-alle-umlaute-der-datenbank.html
*
* @project -
* @author Boris Bojic <bojic@devshack.biz>
* @copyright Copyright (c) 2011, Boris Bojic (DevShack)
* @version Fri, 23 Dec 2011 13:47:11 +0100
* @updated -
@akost
akost / convert.sh
Created April 4, 2012 19:06
Bash script for recursive file convertion windows-1251 --> utf-8
#!/bin/bash
# Recursive file convertion windows-1251 --> utf-8
# Place this file in the root of your site, add execute permission and run
# Converts *.php, *.html, *.css, *.js files.
# To add file type by extension, e.g. *.cgi, add '-o -name "*.cgi"' to the find command
find ./ -name "*.php" -o -name "*.html" -o -name "*.css" -o -name "*.js" -type f |
while read file
do